<?php

use app\assets\ApiAsset;
use app\assets\LayerAsset;
use app\assets\TableAsset;
use app\models\KeyMap;
use app\widgets\LinkPager;
use app\widgets\ManagerTableOp;
use yii\helpers\Html;

/**
 * @var $this yii\web\View
 * @var $smsList app\models\CardSms[]
 * @var $pagination yii\data\Pagination
 */

ApiAsset::register($this);
LayerAsset::register($this);
TableAsset::register($this);

$this->title = '短信列表';
$this->params['breadcrumbs'][] = '物联网卡管理';
$this->params['breadcrumbs'][] = $this->title;
?>
<?php echo Html::beginForm('?', 'get', ['class'=>'form-inline']);?>
<?php echo Html::endForm();?>
<table class="table table-striped table-bordered table-hover">
    <thead>
    <tr>
        <th class="center">
            <label class="pos-rel">
                <input type="checkbox" class="ace" />
                <span class="lbl"></span>
            </label>
        </th>
        <th>卡</th>
        <th>时间</th>
        <th>类型</th>
        <th>内容</th>
        <th>操作</th>
    </tr>
    </thead>

    <tbody>
    <?php foreach ($smsList as $sms) {?>
        <tr>
            <td class="center"><label class="pos-rel"><input type="checkbox" class="ace" value="<?php echo $card->id;?>" /><span class="lbl"><?php echo $card->id;?></span></label></td>
            <td><?php echo Html::a($sms->card->iccid, ['/user/card/user', 'id' => $sms->card_id]);?></td>
            <td><?php echo Yii::$app->formatter->asDatetime($sms->time);?></td>
            <td><?php echo KeyMap::getValue('card_sms_type', $sms->type);?></td>
            <td><?php echo Html::encode($sms->content);?></td>
            <td><?php echo ManagerTableOp::widget(['items' => [
                ]]);?></td>
        </tr>
    <?php }?>
    </tbody>
</table>
<?php echo LinkPager::widget(['pagination' => $pagination]);?>
